package com.fr71.project.dm.service.impl;

import com.fr71.common.utils.DateUtils;
import com.fr71.project.dm.domain.AuthLog;
import com.fr71.project.dm.mapper.AuthLogMapper;
import com.fr71.project.dm.service.IAuthLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 开发者：https://github.com/devzwy
 * 创建时间：2023-08-07
 * 类描述：鉴权日志Service业务层处理
 */
@Service
public class AuthLogServiceImpl implements IAuthLogService {
    
    @Autowired
    private AuthLogMapper authLogMapper;

    /**
     * 查询鉴权日志
     * 
     * @param id 鉴权日志主键
     * @return 鉴权日志
     */
    @Override
    public AuthLog selectAuthLogById(Long id) {
        return authLogMapper.selectAuthLogById(id);
    }

    /**
     * 查询鉴权日志列表
     * 
     * @param authLog 鉴权日志
     * @return 鉴权日志
     */
    @Override
    public List<AuthLog> selectAuthLogList(AuthLog authLog) {
        return authLogMapper.selectAuthLogList(authLog);
    }

    /**
     * 新增鉴权日志
     * 
     * @param authLog 鉴权日志
     * @return 结果
     */
    @Override
    public int insertAuthLog(AuthLog authLog) {
        authLog.setCreateTime(DateUtils.getNowDate());
        return authLogMapper.insertAuthLog(authLog);
    }

    /**
     * 修改鉴权日志
     * 
     * @param authLog 鉴权日志
     * @return 结果
     */
    @Override
    public int updateAuthLog(AuthLog authLog) {
        authLog.setUpdateTime(DateUtils.getNowDate());
        return authLogMapper.updateAuthLog(authLog);
    }

    /**
     * 批量删除鉴权日志
     * 
     * @param ids 需要删除的鉴权日志主键
     * @return 结果
     */
    @Override
    public int deleteAuthLogByIds(Long[] ids) {
        return authLogMapper.deleteAuthLogByIds(ids);
    }

    /**
     * 删除鉴权日志信息
     * 
     * @param id 鉴权日志主键
     * @return 结果
     */
    @Override
    public int deleteAuthLogById(Long id) {
        return authLogMapper.deleteAuthLogById(id);
    }
}